package com.lanou3g.code0410.keyword;

/**
 * If there are no bugs, it was created by Chen FengYao on 2018/4/10;
 * Otherwise, I don't know who created it either
 */
// 如果一个类 写上了final
// 那么它就不能被继承
public final class Person {
    private final String name = "aaa";

    public String getName() {
        return name;
    }



    // 如果一个方法 加上了 final
    // 那么子类是无法覆写这个方法的
    public final void study() {
        // 变量加final 则变量 只能赋值一次
        final int a = 4;


        System.out.println("学习");
    }
}
